import {get, ID} from "./common";
import {computed} from "vue";
import store from "../store";
//根据stationID获取房间及病人详细信息
const getAllPatientInfo = () => {
    return get('/station/getAllPatientInfo', ID);
};

function findByRoomBed(room) {
    const patientData=computed(() => store.state.patientData);
    let returnData=[]
    for (let patient of patientData.value) {
        if (patient.room === room ) {
            returnData.push(patient);
        }
    }
    return returnData;
}


const arrInitialize = (size)=>{
    let arr = new Array(size)
    for(let i=0;i<size;i++){
        arr[i] = i
    }
    return arr;
}

export{
    getAllPatientInfo,
    findByRoomBed,
    arrInitialize
};